<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>参数</title>
    <script type="text/javascript">
    var mainform;
    var viewType = "${viewType}";

    $(function (){
    
        mainform=$("#mainform");
        
        mainform.ligerForm();
        
        if(viewType=="modify"){
        	 $("#sppId").attr("readonly", "readonly").removeAttr("validate");
        }
        
        if(viewType=="detail"){
        	$("input,select,textarea",mainform).attr("readonly", "readonly");
        }else{
            $.metadata.setType("attr", "validate");
            LG.validate(mainform);
        }
        
        LG.setFormDefaultBtn(cancel,viewType=="detail" ? null : save);

    });
   
    function save(){
        LG.submitForm(mainform, function (result) {
        	if(typeof(result)=="string"){
        		result=eval("("+result+")");
        	}
            if (!result.success) {
                LG.showError('错误:' + data.message);
            }
            else { 
                LG.showSuccess('保存成功', function () { 
                   LG.callParent("syspropList");
                });
            }
        });
    }
    function cancel(){
        var win = window.parent || window;
        if(win.dialog){
        	win.dialog.close();
        }
    }
 </script>
</head>

<body>
    <form name="mainform" method="post"  id="mainform" action="${ctx }/sysprop/save">
        <input type="hidden" name="viewType" value="${viewType}"/>
        <table cellpadding="0" cellspacing="0" class="l-table-edit" style="width: 100%;">
            <tr>
                <td align="left" class="l-table-edit-td">参数:</td>
                <td align="left" class="l-table-edit-td" colspan="4">
                	<input name="sppId" type="text" id="sppId" value="${command.sppId }" ltype="text" validate="{required:true,maxlength:36,notnull:true,remote:'${ctx}/sysprop/checkSppId?oldSppId=${command.sppId}'}" nullText="不能为空!"/>
                </td>
                <td align="left"></td>
            </tr>
            <tr>
                <td align="left" class="l-table-edit-td" valign="top">值:</td>
                <td align="left" class="l-table-edit-td" colspan="4">
                	<input name="sppValue" type="text" id="sppValue" value="${command.sppValue }" ltype="text" validate="{required:true,maxlength:100,notnull:true}" nullText="不能为空!"/>
                </td>
                <td align="left"></td>
            </tr>
            <tr>
                <td align="left" class="l-table-edit-td" valign="top">用途说明:</td>
                <td align="left" class="l-table-edit-td" colspan="4">
                	<input name="sppTitle" type="text" id="sppTitle" value="${command.sppTitle }" ltype="text" validate="{required:true,maxlength:100,notnull:true}" nullText="不能为空!"/>
                </td>
                <td align="left"></td>
            </tr>
            <tr>
                <td align="left" class="l-table-edit-td">备注:</td>
                <td align="left" class="l-table-edit-td" colspan="4"> 
                <textarea cols="100" rows="3" class="l-textarea" id="remark" name="remark" style="width:400px">${command.remark}</textarea>
                </td> <td align="left"></td>
           </tr>
           
           <tr>
                <td align="left" class="l-table-edit-td" valign="top">建档人:</td>
                <td align="left" class="l-table-edit-td" style="width:160px">${command.userCre }</td>
                <td align="left"></td>
                
                <td align="left" class="l-table-edit-td" valign="top">修改人:</td>
                <td align="left" class="l-table-edit-td" style="width:160px">${command.userUpd }</td>
                <td align="left"></td>
           </tr>
        </table>
    </form>
</body>
</html>
